package com.tanhua.model.vo;


import cn.hutool.core.collection.CollUtil;

import com.tanhua.model.mongo.Analysis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReportVo {

    private String conclusion; //分析结果
    private String cover ;
    private List<DimensionsVo> dimensions;//维度
    private List<SimilarYouVo> similarYou; //和你相似

    public static ReportVo init(Analysis analysis, List<DimensionsVo> dim, List<SimilarYouVo> similarU){
        ReportVo vo = new ReportVo();
        vo.setConclusion(analysis.getResult());
        vo.setCover(analysis.getCover());
        vo.setDimensions(dim);

        if (!CollUtil.isEmpty(similarU)){
            vo.setSimilarYou(similarU);
        }

        return vo;
    }

}
